<?php
class errorHandle{
	public static function notFound(){
		@ob_clean();
		@ob_end_clean();
		header("HTTP/1.1 404 Not Found");
		header("Status: 404 Not Found");
		die;
	}
	
	public static function error($e){
		//@ob_clean();
		//@ob_end_clean();
        //@header("Content-Type:text/html;charset=utf-8");
        foreach ($e->getTrace() as $val)
        {
         	print '文件'.$val['file'].'第'.$val['line'].'行'.$val['class'].$val['type'].$val['function']."<br/>\n";
        }
		print "出错啦!<br/>\n";
		print $e->getMessage(); 
		exit(); 
	}
    public static function classNotFound($class)
    {
    	#die("$class not found ");
        self::notFound();
    }

    public static function fileNotFound($file)
    {
    	#die("$file not found ");
        self::notFound();
    }

	public static function methodNotFound($method)
	{
		#die("$method not found ");
		self::notFound();
	}

	public static function ParameterErrors($parame)
	{
		die("$parame not found ");
	}

	public static function apiNotFound($m, $a)
	{
		self::notFound();
		#die("error : api not found ");
	}
}

